<template>
  <div class="goods" @click="goodsDetail" :style="styleData" :data-id="item.goods_id">
    <div class="picture">
      <img v-lazy="{src:item.img640_url,loading:lazyPic}" alt="">
      <span class="info">精选价<i>￥</i><i class="price">{{item.flash_price}}</i></span>
    </div>
  </div>
</template>

<script>
  export default {
    props:['parentData','styleData'],
    data(){
      return{item:{},lazyPic:require('../../../assets/img/publicImg/loading_default.png') }
    },
    created(){
      this.item=this.parentData;
      
    },
    methods:{
      goodsDetail(){
        this.$emit('childEvent',this.item.goods_id);
      }
    }
  }
</script>

<style lang="less" scoped>
.goods{
  width: 3.42rem;
  padding: 0.06rem;
  margin-right: 0.12rem;
  font-family: '微软雅黑';
  background: #fff;
  font-size: 0.24rem;
  box-sizing: border-box;
  position: relative;
  &:last-child{margin-right: 0;}
  .picture{
    width: 100%;
    padding-top: 100%;
    position: relative;
    img{
      width: 100%;
      position: absolute;
      top: 0;left: 0;
    }
    .info{
      display: block;
      width: 100%;
      line-height: 0.5rem;
      text-align: center;
      font-size: 0.24rem;
      background: #090909;
      color: #FECB0E;
      i{
        font-style: normal;
        font-size: 0.18rem;
      }
      .price{
        font-family: '微软雅黑';
        font-size: 0.3rem;
        font-weight: 600;
      }
    }
  }
}
</style>